package com.hy.video.monitor.service.admin;

import com.hy.video.monitor.annotation.RoleAdminOrRead;
import com.hy.video.monitor.domain.Role;
import com.hy.video.monitor.repository.PermissionRepo;
import com.hy.video.monitor.domain.Permission;
import com.querydsl.core.types.Predicate;
import lombok.RequiredArgsConstructor;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import java.util.List;

@RequiredArgsConstructor
@Service
public class PermissionAdminService {

    private final PermissionRepo permissionRepo;

    //@RoleAdminOrRead
    public List<Permission> findAll() {
        return permissionRepo.findAll();
    }
    public Page<Permission> findAll(Predicate predicate, Pageable pageable) {
        return permissionRepo.findAll(predicate, pageable);
    }
}
